3af9ebbb5c3ae9e0ff8b7b963185ce03836ba0fa,subprojects/gradle-plugins/src/main/groovy/org/gradle/api/tasks/compile/GroovyCompile.java,GroovyCompile,compile,#,47

Before Change


        if (getAntGroovyCompile() == null) {
            throw new InvalidUserDataException("The ant groovy compile command must be set!");
        }
        if (getSourceCompatibility() == null || getTargetCompatibility() == null) {
            throw new InvalidUserDataException("The sourceCompatibility and targetCompatibility must be set!");
        }

        List<File> classpath = GUtil.addLists(getClasspath());
        // todo We need to understand why it is not good enough to put groovy and ant in the task classpath but also Junit. As we don't understand we put the whole testCompile in it right now. It doesn't hurt, but understanding is better :)
        List<File> taskClasspath = new ArrayList<File>(getGroovyClasspath().getFiles());
        throwExceptionIfTaskClasspathIsEmpty(taskClasspath);
        antGroovyCompile.execute(getSource(), getDestinationDir(),
                classpath, getSourceCompatibility(), getTargetCompatibility(), getGroovyOptions(), getOptions(),
                taskClasspath);
        setDidWork(antGroovyCompile.getNumFilesCompiled() > 0);
    }

After Change


        groovyCompiler.setSource(getSource());
        groovyCompiler.setDestinationDir(getDestinationDir());
        groovyCompiler.setClasspath(getClasspath());
        groovyCompiler.setSourceCompatibility(getSourceCompatibility());
        groovyCompiler.setTargetCompatibility(getTargetCompatibility());
        groovyCompiler.setGroovyClasspath(taskClasspath);
        WorkResult result = groovyCompiler.execute();
        setDidWork(result.getDidWork());